\ifwhole\else
\end{document}
\fi